package sc.math;

/**
 * The CubicCurve interface provides definitions for objects that represent some
 * form of cubic curve. Each CubicCurve object provides methods to return a
 * specified interval and inform at which control points the curve starts and
 * ends.
 */
public interface CubicCurve {

	/**
	 * Returns the interval at i along the curve specified by the four control
	 * points a, b, c and d.
	 * 
	 * @param i
	 *            Location of interval along curve [0, 1]
	 * 
	 * @return the interval
	 */
	public double interval(double a, double b, double c, double d, double i);

	/**
	 * Gets the index of the control point from where the curve starts.
	 * 
	 * This is a fairly pointless method, only needed to enable a generic
	 * Spline2D. Depending on the type of CubicCurve, the curve starts and ends
	 * at different control points.
	 * 
	 * @return index of the control point from where the curve starts
	 */
	public int startIndex();

	/**
	 * Gets the index of the control point from where the curve ends.
	 * 
	 * This is a fairly pointless method, only needed to enable a generic
	 * Spline2D. Depending on the type of CubicCurve, the curve starts and ends
	 * at different control points.
	 * 
	 * @return index of the control point from where the curve ends
	 */
	public int endIndex();

}
